package com.gdufe.seckill.controller;

import com.gdufe.common.utils.PageUtils;
import com.gdufe.common.utils.R;
import com.gdufe.seckill.entity.SessionEntity;
import com.gdufe.seckill.service.SessionUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("seckill/session/user")
public class SessionUserController {
    @Autowired
    private SessionUserService sessionService;

    /**
     * 获取所有场次信息
     * @return
     */
    @RequestMapping("/getSessions")
    public R getSessions(){
        List<SessionEntity> sessions = sessionService.getSessions();
        return R.ok().put("sessions",sessions);
    }

}
